<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>手机信息</title>
</head>
<style>
#bt {
	text-align: center;
}
</style>
<body>
	<table border="1" align="center">
		<tr>
			<td colspan="9" id="bt">手机信息</td>
		</tr>
		<tr>
			<td>编号</td>
			<td>品牌型号</td>
			<td>参考价格</td>
			<td>网络模式</td>
			<td>网络类型</td>
			<td>外观设计</td>
			<td>主屏尺寸</td>
			<td>外观设计</td>
			<td>操作</td>
		</tr>
		<tbody id="tj">

		</tbody>
	</table>
</body>
</html>
<script src="js/jquery-1.7.2.min.js"></script>
<script>
	//显示信息列表
	$(function() {
		$.ajax({
			"url" : "/maven_test/HandsetServlet",
			"type" : "get",
			"data" : {
				"act" : "list"
			},
			"dataType" : "text",
			"success" : function(res) {
				$("#tj").append(res);
			},
			"error" : function() {
				alert("出错了");
			}
		});
	});

	

	//删除某条信息
	function del(hsId) {
		$.ajax({
			"url" : "/maven_test/HandsetServlet",
			"type" : "get",
			"data" : {
				"act" : "del",
				"hsId" : hsId
			},
			"dataType" : "text",
			"success" : function(res) {
				//判断是否删除成功
				if (res.indexOf("true") > -1) {
					alert("删除成功");
					window.location.reload("handset.jsp");
				} else {
					alert("删除失败");
				}
			},
			"error" : function() {
				alert("出错了");
			}
		});
	};
</script>